<{include file="_head.html"}>
<!-- 弹框 -->
<script type="text/javascript" src="js/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="js/jquery.qqFace.js"></script> 
<script type="text/javascript">
$(function(){
    $(document).ready(function() {
         $(".various1").fancybox({
            'titlePosition':'inside',
            'transitionIn':'none',
            'transitionOut':'none'
        });

    });

    //添加、删除关注
    $(".brkd_sx2").click(function(){
        var url='user_main.php?id=<{$smarty.get.id}>&type=<{$smarty.get.type}>&action=addFocus';
        var isfocus=$(this).attr("isfocus");
        var types=$(this).attr("types");
        var bgz=$("#bgz").html();
        bgz=isfocus==''?parseInt(bgz)+1:parseInt(bgz)-1; 
        $.post(
            url,
            {isfocus:isfocus,types:types},
            function(data){
                if(data.error==1){
                    alert(data.msg);
                    $('.brkd_sx2').attr("isfocus",data.id);
                    $('.brkd_sx2').html(data.title);
                    $("#bgz").html(bgz);
                }else{
                    alert(data.msg);
                    if(data.error==2){
                        window.location.href="login.php";
                    }
                }
            },'json'
            )
    })

    //发送私信
     $(".j_logn_n2").click(function(){
        var content=$("#saytext").val();
        var to_user=$("input[name='to_user']").val();
        if(content!='' && content!=null){
            $.post(
                'user_main.php?action=sendLetter',
                {content:content,to_user:to_user},
                function(data){
                  if(data.error==0){
                     alert(data.msg);
                     $("#saytext").val('');
                     $("#fancybox-overlay").trigger("click");
                  }else{
                    alert("请先登录！");
                    window.location.href="login.php";
                  }
             },"json")


        }else{
            alert('随便说点什么吧')
        }

     })
        $('.emotion').qqFace({ // 
          id : 'facebox', //表情盒子的ID
          assign:'saytext', //给那个控件赋值
          path:'images/face/' //表情存放的路径，注意如果修改了这个地方，下面正则匹配的地方也要做相应的修改
        });

})
</script>
<{include file="head.html"}>

<!-- banner-开始 -->
<div class="j_gzls">
	<div class="j_gzlsn">
    	<span class="j_gzlsnz"><img src="upload/<{$smarty.get.type}>/large/<{$user.avatar}>" width='150px;' height='150px;'/></span>
        <div class="j_gzlsny">
        	<span class="j_gzlsnys">
            <{if $user.sex=='male'}>
             <img src="images/gz/gz_03.png" />
            <{else}>
              <img src="images/gz/gz_04.png" />
            <{/if}>
            <{if $smarty.get.type=='admin'}>小编：<{/if}>
             <{$user.account}></span>
            <span class="j_gzlsnyc"><{$user.self_intro}></span>
        	<span class="j_gzlsnyb"><img src="images/gz/gz_09.png" /><{$user.cityName}></span>
        	<span class="j_gzlsnyx">
            	<!-- <a href="#"><img src="images/gz/gz_15.png" /></a> -->
            	<a href="#"><img src="images/gz/gz_17.png" /></a>
            	<a href="#"><img src="images/gz/gz_19.png" /></a>
            	<a href="#"><img src="images/gz/gz_21.png" /></a>
            </span>
            <!-- <div class="gzbj"><a href="#">编辑我的资料</a></div> -->
        </div>
    </div>
</div>
<!-- banner-结束 -->

<!-- 主体内容-开始 -->
<div class="j_gzln">
	<div class="j_gzlnz">
    	<div class="j_gzlnzt">TA的文章</div>

        <{foreach item=loop from=$row}>
        <div class="j_gzlnzn">
        	<a  href="info_detail.php?id=<{$loop.id}>"><span class="gzbrk"><img src="upload/info/large/<{$loop.thumbnail}>" width="299px" height="196px"/></span></a>
        	<div class="gzbrky">
            	<a href="info_detail.php?id=<{$loop.id}>"><span class="gzbrkys"><{$loop.title}></span></a>
                <span class="gzbrkyc"><{$loop.intro|truncate:100}></span>
                <span class="gzbrkyx"><a href="#">more &gt;&gt;</a></span>
                <div class="gzbrkyb">
                	<span class="gzbrkybz"><{$loop.className}></span>
                    <span class="gzbrkyby">
                    	<a href="#" class="gzbrkyby1"><{$loop.click_num}></a>
                    	<a href="#" class="gzbrkyby2"></a>
                    	<a href="#" class="gzbrkyby3"></a>
                    	<a href="#" class="gzbrkyby4"></a>
                    </span>
                </div>
            </div>
        </div>
         <{/foreach}>

        
        <div class="j_fy">
         <ul class="ul_page">
            <{$page}>
         </ul>
        </div>
            
    </div>
    <div class="j_gzlny">
    	<div class="j_gzlnys">
        	<span class="j_gzlnysz">
            	<span class="j_gzlnyszs">关注了</span>
            	<a href="user_attention.php?id=<{$user.id}>"><span class="j_gzlnyszx"><span><{$gz}></span>人</span></a>
            </span>
        	<span class="j_gzlnysz" style="border:0;">
            	<span class="j_gzlnyszs">关注者</span>
            	<span class="j_gzlnyszx"><span id="bgz"><{$bgz}></span>人</span>
            </span>
        </div>
        <div class="brkd_sx">
            <{if $smarty.get.type=='user'}>
        	<a href="#inline3" class="brkd_sx1 various1">私信TA</a>
            <{/if}>
        	<a href="javascript:;" isfocus="<{$isfocus}>" types="<{$smarty.get.type}>" class="brkd_sx2"><{if $isfocus!=''}>不关注<{else}>关注TA<{/if}></a>
        </div>
        <span class="j_gzlnyx">个人主页被140人浏览</span>
    </div>
</div>
<!-- 主体内容-结束 -->

<!-- footer -->
<{include file="footer.html"}>
<input type="hidden" name="to_user" value="<{$user.id}>" />
<!-- 登录2-开始 -->
<div style="display:none;">
  <div class="j_logn" id="inline3" >
      <div class="j_logn_logo" ><img src="upload/user/small/<{$user.avatar}>" width="120" height="120" /></div>
        <span class="j_logn_log"><{$user.account}></span>
        <div class="j_logn_n">
            <a href="javascript:;" class="emotion">表情</a>
            <textarea style="height:80px;" class="j_logn_n1"  placeholder="你好..." id="saytext" ></textarea>
            <input type="button" class="j_logn_n2" value="发送" />
        </div>
    </div>
</div>
  <!-- 登录2-结束 -->